home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / ginsu / clip.h < prev    next >
C/C++ Source or Header  |  1992-11-17  |  1KB  |  97 lines

  1. #include <stdlib.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4. #include <math.h>
  5. #include <stdio.h>
  6.  
  7. class vertex
  8. {
  9.  public:
  10.  vertex();
  11.  void read_vertex(int, FILE *);
  12.  void read_cvertex(int, FILE *);
  13.  void read_cnvertex(int, FILE *);
  14.  vertex *next;
  15.  double x,y,z;
  16.  float vr,vg,vb;
  17.  int clip;
  18.  int num;
  19. };
  20.  
  21. class vertex_list
  22. {
  23.  public:
  24.  vertex_list();
  25.  void read_vertices(int, FILE *);
  26.  void write_vertices(FILE *);
  27.  void clip_vertex(int, char**);
  28.  void put_in_array(vertex **);
  29.  vertex *add_vertex(double, double, double, float, float, float);
  30.  void refresh_vertex_list();
  31.  int numvtx;
  32.  double a,b,c,d;
  33.  int ptype;
  34.  int side;
  35.  
  36.  private:
  37.  vertex *head;
  38.  vertex *point;
  39. };
  40.  
  41. class pvtx
  42. {
  43.  public:
  44.  pvtx();
  45.  void read_pvtx(FILE *);
  46.  int num;
  47.  vertex *me;
  48.  pvtx *next;
  49. };
  50.  
  51. class polyvtx_list
  52. {
  53.  public:
  54.  polyvtx_list();
  55.  void read_polyvtx(int, FILE *);
  56.  void write_polyvtx(FILE *);
  57.  int find_unclipped_vertex(vertex **);
  58.  int clip_each_vertex(vertex_list *, vertex **);
  59.  int numvtx;
  60.  
  61.  private:
  62.  pvtx *head;
  63.  pvtx *point;
  64. };
  65.  
  66.  
  67. class poly
  68. {
  69.  public:
  70.  poly();
  71.  void read_poly(FILE *);
  72.  void clip_poly(vertex_list * cli, vertex **);
  73.  int numvtx;
  74.  int clipped;
  75.  polyvtx_list *me;
  76.  float r,g,b,tr;
  77.  poly *next;
  78. };
  79.  
  80. class poly_list
  81. {
  82.  public:
  83.  poly_list();
  84.  void read_polys(int, FILE *);
  85.  void write_polys(FILE *);
  86.  void clip_polys(vertex_list *);
  87.  void refresh_poly_list();
  88.  int numpoly;
  89.  int ptype;
  90.  
  91.  private:
  92.  poly *head;
  93.  poly *point;
  94. };
  95.  
  96. void main_clip(int, char *[]);
  97.